package top.xchch.crud.entity;

import java.util.Date;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;

import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.NumberFormat;
import org.springframework.stereotype.Component;


public class Student {
	
	private Integer sid;
	@NotNull
	private String sname;
	
	@Past
	@DateTimeFormat(pattern="yyyy-MM-dd")
	private Date birth;
	
	@NumberFormat(pattern="#,###.##")
	private Float salary;

	
	public Student() {}
	public Student(Integer sid, String sname, Date birth) {
		super();
		this.sid = sid;
		this.sname = sname;
		this.birth = birth;
	}

	public Integer getSid() {
		return sid;
	}
	public void setSid(Integer sid) {
		this.sid = sid;
	}
	public String getSname() {
		return sname;
	}
	public void setSname(String sname) {
		this.sname = sname;
	}
	public Date getBirth() {
		return birth;
	}
	public void setBirth(Date birth) {
		this.birth = birth;
	}
	public Float getSalary() {
		return salary;
	}
	public void setSalary(Float salary) {
		this.salary = salary;
	}
	
	@Override
	public String toString() {
		return "Student [sid=" + sid + ", sname=" + sname + ", birth=" + birth + ", salary=" + salary + "]";
	}
}

/**
 
create table tal_employee(
	id int(11) primary key auto_increment,
	last_name varchar(255),
	gender char(1),
	email varchar(255)
);
  
 */
